<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
  html{
    background: #AAAAAA;
  }
  body{
    max-width: 750px;
    margin: auto;
    margin-top: 0;
  }
textarea:focus,
input:focus{
  outline:1px solid #316ccb;
}
textarea,
input{
  display: block;
  padding: 10px 20px;
  width: 100%;
  box-sizing: border-box;
  border:none;
  margin-top: 10px;
}
.btn{
  display: block;
  margin-top: 10px;
  text-align: center;
  line-height: 40px;
  text-decoration: none;
  color: #fff;
  background: #316ccb;
}
.btn.default{
  background: #fff;
  border: 1px solid #316ccb;
  color: #000;
}

canvas{
  width: 100%;
  max-width: 720px;
  margin: auto;
  background: #fff;
  display: block;
  margin-top: 10px;
}
</style>
</head>
<body>
  <input type="text" placeholder="请输入在红包上显示的文字">
  <canvas width="720" height="1280"></canvas>
  <script>
  var $ = document.querySelector.bind(document)
  function drawImage(ctx,url){
    var img = document.createElement("img")
    img.src=url
    img.onload=function(){
      ctx.drawImage(img,0,0)
    }
  }
  var canvas = $("canvas")
	var context = canvas.getContext("2d")
  drawImage(context,"../img/zfbhb-mb.png")
  </script>
</body>
</html>
